# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Maintainer: Jan de Groot <jgc@archlinux.org>

pkgname=gnome-music
pkgver=3.30.1
pkgrel=1
epoch=1
pkgdesc="Music player and management application"
url="https://wiki.gnome.org/Apps/Music"
arch=(x86_64)
license=(GPL)
depends=(grilo grilo-plugins tracker-miners libdmapsharing libmediaart gtk3 gvfs python-gobject
         python-cairo gst-plugins-base python-requests libdazzle)
makedepends=(gobject-introspection git meson yelp-tools appstream-glib)
optdepends=('gst-plugins-good: Extra media codecs'
            'gst-plugins-ugly: Extra media codecs'
            'gst-plugins-bad: Extra media codecs'
            'gst-libav: Extra media codecs')
groups=(gnome)
_commit=43f7f441760895c8946d8b244d5981b94dd737d5  # tags/3.30.1^0
source=("git+https://gitlab.gnome.org/GNOME/gnome-music.git#commit=$_commit"
        "git+https://gitlab.gnome.org/GNOME/libgd.git")
sha256sums=('SKIP'
            'SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname

  git submodule init
  git config --local submodule.subprojects/libgd.url "$srcdir/libgd"
  git submodule update
}

build() {
  arch-meson $pkgname build
  ninja -C build
}

check() {
  meson test -C build
}

package() {
  DESTDIR="$pkgdir" meson install -C build

  python -m compileall -d /usr/lib "$pkgdir/usr/lib"
  python -O -m compileall -d /usr/lib "$pkgdir/usr/lib"
}
